package com.holyant.goods.dto;

import com.ruoyi.common.core.constant.Constants;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.collections4.CollectionUtils;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * echarts 结算价
 *
 * @author zgx *
 * @date 2022年06月28日 9:54
 */

@Builder
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GdsSettlementScopeDto {

    private static Map<String,Object> maps=new HashMap<>();

    private String name;
    private String type;
    private String step;
    private List<String> data;



    public static Map<String,Object> getSuccessResult(List<GdsSettlementScopeDto> gdsSettlementScopeDto){
        maps.put("code", Constants.SUCCESS);
        maps.put("msg","操作成功");
        maps.put("data", CollectionUtils.isEmpty(gdsSettlementScopeDto)?null: gdsSettlementScopeDto);
        maps.put("legend",CollectionUtils.isEmpty(gdsSettlementScopeDto)?null:gdsSettlementScopeDto.stream().map(GdsSettlementScopeDto::getName));
        return maps;
    }

}
